<template>
  <!-- 支付宝支付界面 -->
  <div>
    <van-cell title="订单号" :value="orderId" />
    <van-cell title="金额" :value="total" />
    <van-button type="info" style="margin: 30px 40% " @click="topay">支付测试</van-button>
  </div>
</template>
<script>

import {doPayOrder} from "@/api/order";

export default {
  components: {},
  props: [],
  data() {
    return {
      orderId: "",
      total:""
    };
  },
  mounted() {
    this.orderId=this.$store.state.orderId;
    this.total=this.$store.state.total;
  },
  methods: {
    topay(){
      doPayOrder(this.orderId).then(res=>{
        if (res.code===200){
            this.$store.state.orderId="";
            this.$store.state.total=0;
            this.$router.push('order')
        }
      })
    }
  },
};
</script>
<style >

</style>
